{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# User Guide\n", "\n", "## Geometries on a map: `GeoVector`" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import telluric as tl\n", "from telluric.constants import WGS84_CRS, WEB_MERCATOR_CRS" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The simplest geometrical element in telluric is the [GeoVector](http://telluric.readthedocs.io/en/latest/api.html#telluric.vectors.GeoVector): it represents a shape in some coordinate reference system (CRS). The easiest way to create one is to use the `GeoVector.from_bounds` method:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "GeoVector(shape=POLYGON ((0 40, 0 41, 1 41, 1 40, 0 40)), crs=CRS({'init': 'epsg:4326'}))\n" ] } ], "source": [ "gv1 = tl.GeoVector.from_bounds(\n", " xmin=0, ymin=40, xmax=1, ymax=41, crs=WGS84_CRS\n", ")\n", "print(gv1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we print the object, we see its two defining elements: a shape (actually a shapely `BaseGeometry` object) and a CRS (in this case WGS84 or http://epsg.io/4326). Rather than reading a dull representation, we can directly visualize it in the notebook:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/juanlu/Satellogic/telluric/telluric/plotting.py:141: UserWarning: Plotting a limited representation of the data, use the .plot() method for further customization\n", " \"Plotting a limited representation of the data, use the .plot() method for further customization\")\n" ] }, { "data": { "image/svg+xml": [ "" ], "text/html": [ "